<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">

<!-- Custom styles for this template -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/dashboard.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/adminnav.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap/css/style.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/prettify.min.js"></script>
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/multiselect.min.js"></script>

<script type="text/javascript">
    $(document).ready(
        function () {
            var currentPage = ${page.currentPage};
            var totalPage = ${page.totalPage};

            $("#pagination1").pagination({
                currentPage: currentPage,
                totalPage: totalPage,
                callback: function (current) {//current 当前页
                    var info = $("#pagination1").pagination("getPage");
                    location.href = "${pageContext.request.contextPath}/size/sizeList?currentPage=" + info.current;
                }
            });
        });
</script>

<c:import url="../common/adminTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">

            <c:import url="../common/adminLeftNav.jsp"/>

        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <%--content--%>
            <h2 class="sub-header">管理商品展示图片</h2>
            <div class="col-sm-6 col-sm-offset-3 col-md-8 col-md-offset-2">
                <c:forEach items="${desc_pics}" var="pic">
                    <div class="row">
                        <div class="col-sm-6 col-md-7">
                            <img src="${pic}" width="500" height="500">
                        </div>
                        <div class="col-sm-2 col-md-3 ">
                            <a href="${pageContext.request.contextPath}/product/delDescPics?pid=${param.pid}&pic=${pic}"
                               class="btn btn-primary" onclick="return confirm('你确定要删除该张图片吗？')">删除图片</a>
                        </div>
                    </div>
                </c:forEach>
                <%--多图片上传--%>
                <form class="form" role="form" method="post"
                      action="${pageContext.request.contextPath}/product/addDescPics"
                      enctype="multipart/form-data">
                    <input type="hidden" name="pid" value="${param.pid}"/>
                    <div class="form-group">
                        <label for="goodsPic"> 商品图片（图片规格：500*500）</label>
                        <input class="form-control" name="pictures" type="file" required/>
                    </div>
                    <div class="form-group">
                        <label for="goodsPic"> 商品图片（图片规格：500*500）</label>
                        <input class="form-control" name="pictures" type="file"/>
                    </div>
                    <div class="form-group">
                        <label for="goodsPic"> 商品图片（图片规格：500*500）</label>
                        <input class="form-control" name="pictures" type="file"/>
                    </div>
                    <div class="form-group">
                        <label for="goodsPic"> 商品图片（图片规格：500*500）</label>
                        <input class="form-control" name="pictures" type="file"/>
                    </div>
                    <div class="form-group">
                        <label for="goodsPic"> 商品图片（图片规格：500*500）</label>
                        <input class="form-control" name="pictures" type="file"/>
                    </div>
                    <button class="btn btn-primary" type="submit">添加图片</button>
                    <button class="btn btn-primary" id="back" type="button"
                            onclick="javascript:location.href='${pageContext.request.contextPath}/product/descPicsList'">返回列表
                    </button>
                </form>

            </div>

        </div>
    </div>
</div>

<c:import url="../common/page_bottom.jsp"/>

<c:import url="../common/adminFooter.jsp"/>

</body>
</html>